<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePetTripsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('pet_trips', function (Blueprint $table) {
            $table->id();
            $table->integer('peid')->default(0)->comment('宠物ID');
            $table->string('lat')->default(0)->comment('纬度');
            $table->string('lon')->default(0)->comment('经度');
            $table->timestamps();
            $table->index('peid');
        });
        DB::statement("ALTER TABLE `pet_trips` comment '宠物行程表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('pet_trips');
    }
}
